#include "EpilParameterListCode.h"
#include "EpilOutputHelper.h"
#include "TCharSupport.h"


EpilParameterListCode::EpilParameterListCode( const EpilLexLocation & location )
: EpilCodeBase( location )
{
}


EpilParameterListCode::~EpilParameterListCode()
{
}


tstring EpilParameterListCode::ToEpilCode( int indent ) const
{
	if( m_parameterNames.empty() )
	{
		return m_hasVariousParameters ? t("( ... )") : t("()");
	}

	tstringstream ret;
	ret << t("( ");
	ret << EpilOutputHelper::GetListOutput( m_parameterNames, t(", ") );
	if( m_hasVariousParameters )
	{
		ret << t(", ...");
	}
	ret << t(" )");
	return ret.str();
}